#ifndef __LOGIN_H__
#define __LOGIN_H__

#define FALSE   (0)
#define TRUE    (1)

enum {
	LOGIN_PARAM_NULL = 1,
	LOGIN_OPEN_FILE_FAIL,
	LOGIN_WRITE_FILE_FAIL,
	LOGIN_ENCIPHER_FAIL,
	LOGIN_DECIPHER_FAIL,
};

#define ACCOUNT_LENGTH   (11)
#define PASSWORD_LENGTH  (11)

#define LOGIN_INFO_FILE    "./lib/user_account.txt"
#define LIB_DIR            "./lib"

struct login_info {
	int is_login;
	char account[ACCOUNT_LENGTH];
	char password[PASSWORD_LENGTH];
	char enter_password[PASSWORD_LENGTH];
};

extern int user_login(struct login_info *login_info_p);
extern int user_register(struct login_info *login_info_p);
extern int user_logout(struct login_info *login_info_p);

#endif
